﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace PRE.Thongke_Baocao
{
    public partial class FrmThongKeCacSanPhamCuaDoanhNghiep : DevExpress.XtraEditors.XtraForm
    {
        public FrmThongKeCacSanPhamCuaDoanhNghiep()
        {
            InitializeComponent();
        }


        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        public string _msDN;
        public string _tenDN;
        public string _diachi;
        public string _dienthoai;
        public string _fax;
        public string _malv;
        DAL.ThongKeBaoCaoDAL _dal = new DAL.ThongKeBaoCaoDAL();
        private void FrmThongKeCacSanPhamCuaDoanhNghiep_Load(object sender, EventArgs e)
        {
            txtmadn.Text = _msDN;
            txttendn.Text = _tenDN;
            txtdiachi.Text = _diachi;
            txtsdt.Text = _dienthoai;
            txtfax.Text = _fax;
            cbolinhvuc.Text = _malv;
            
            grcMain.DataSource = _dal.select_thongkecacSP_DN(_msDN);
            grcMain.Enabled = true;

        }

        private void dockPanel1_Click(object sender, EventArgs e)
        {

        }

        private void btin_Click(object sender, EventArgs e)
        {
            string id = txtmadn.Text.Trim();
            DataTable dtb_report = _dal.select_report_thongkecacSP_DN(id);

            var frm = new Report.Report_Base();
            var xr = new Report.XRSanPhamDN();

            xr.DataSource = dtb_report;
            frm.SetReport(xr);

            frm.Show();
        }
    }
}